<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>isObjectLike</title>
</head>

<body>
    <script>
        const isObjectLike = val => val !== null && typeof val === 'object';
        const tasks = [
            { key: "isObjectLike({})", value: isObjectLike({}) },
            { key: "isObjectLike([1, 2, 3])", value: isObjectLike([1, 2, 3]) },
            { key: "isObjectLike(x => x)", value: isObjectLike(x => x) },
            { key: "isObjectLike(null)", value: isObjectLike(null) }
        ]
        document.write(tasks.map(({ key, value }) => `<p>${key}的结果是:${value};</p>`).join(''))
    </script>
</body>

</html>